export default {
    setUser (state, user) {
        // console.log(user)
        state.user = user
        localStorage.setItem('user', JSON.stringify(user))
    }
    // getCartList (state, data) {
    //     localStorage.setItem('cart', JSON.stringify(data))
    // }
    // register (state, values) {
    //     console.log(values)
    //     const userData = localStorage.getItem('userData') ? JSON.parse(localStorage.getItem('userData')) : []
    //     if (userData.some(item => item.username === values.username)) {
    //         state.userRepeat = true
    //     } else {
    //         state.userRepeat = false
    //         userData.push(values)
    //         localStorage.setItem('userData', JSON.stringify(userData))
    //     }
    // }
}
